package com.lbj.service.impl;

import com.lbj.dao.UserDao;
import com.lbj.dao.impl.UserDaoImpl;
import com.lbj.domain.Topic;
import com.lbj.domain.User;
import com.lbj.service.UserService;

import java.util.List;
import java.util.Map;

public class UserServiceImpl implements UserService {
    UserDao userDao = new UserDaoImpl();

    @Override
    public User login(String loginAct, String loginPwd) {
        return userDao.login(loginAct,loginPwd);
    }

    @Override
    public boolean register(User user) {
        return userDao.register(user)==1?true:false;
    }

    @Override
    public List<User> getUsers() {
        return userDao.getUsers();
    }

    @Override
    public Boolean deleteUserById(String id) {
        return userDao.deleteUserById(id)==1 ?true:false;
    }

    @Override
    public User getUserById(String id) {
        return userDao.getUserById(id);
    }

    @Override
    public boolean modUserById(User user) {
        return userDao.modUserById(user)==1?true:false;
    }

    @Override
    public List<User> getUsersByCondition(Map<String, String> conditions) {
        return userDao.getUserByCondition(conditions);
    }


}
